package leetcode_数与位._02简单数学题;

/**
 * @author yzh
 * @data 2021/3/27 21:33
 * 构造矩形
 * 思路：
 *   求数的公因数
 *   4 -- 1 2 2 4
 */
public class _492_构造矩形 {
    public static void main(String[] args) {
        System.out.println((int)(Math.sqrt(5)));
    }

    public int[] constructRectangle(int area) {
        int n = (int)(Math.sqrt(area));
        int[] ans = new int[2];
        for (int i = 1; i <= n; i++) {
            if (area % i == 0) {
                ans[0] = area / i;
                ans[1] = i;
            }
        }
        return ans;
    }
}
